﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ESRI.ArcGIS.ADF.BaseClasses;
using PlanningGIS.Framework;

namespace PlanningGIS.Raster
{
    public class ShopCmd : BaseCommand
    {
         /// <summary>
        /// 
        /// </summary>
        IApplication m_Application = null;
        /// <summary>
        /// 
        /// </summary>
        public ShopCmd()
        {
            base.m_caption = "我的购物车";
            base.m_toolTip = base.m_caption;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="hook"></param>
        public override void OnCreate(object hook)
        {
            if (m_Application == null)
            {
                m_Application = hook as IApplication;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public override void OnClick()
        {
            if (m_Application == null)
                return;
            FrmShop frmShop = FrmShop.GetShopFrm();
            frmShop.Visible = false;
            frmShop.Map = m_Application.Document.get_Map(0);
            frmShop.Show((m_Application as IFramework).MdiForm);
        }
        /// <summary>
        /// 
        /// </summary>
        public override bool Enabled
        {
            get
            {
                if (m_Application == null)
                    return false;
                return (m_Application as IFramework).IsMapCtrlactive;
            }
        }
    }
}
